import request from "@/utils/request.js";

// 根据分类id获取商品规格列表
export function getCategorySpecAll(categoryId) {
    return request({
        url: '/product/productSpec/productSpecList/' + categoryId,
        method: 'get'
    })
}

// 根据分类获取分类规格
export function listSpec(productSpec) {
    return request({
        url: '/product/productSpec/list',
        method: 'get',
        params:productSpec
    })
}

// 获取商品规格详细信息
export function getSpec(id) {
    return request({
        url: '/product/productSpec/'+id,
        method: 'get',
    })
}

// 新增商品规格
export function addSpec(productSpec) {
    return request({
        url: '/product/productSpec',
        method: 'post',
        data:productSpec
    })
}

// 修改商品规格
export function updateSpec(productSpec) {
    return request({
        url: '/product/productSpec',
        method: 'put',
        data:productSpec
    })
}

// 删除商品规格
export function delSpec(ids) {
    return request({
        url: '/product/productSpec/'+ids,
        method: 'delete',
    })
}
